<?php

use Biz\service\brand\BlindBox;
use Doraemon\service\Point;
use Doraemon\service\User;

/**
 * 盲盒信息接口（盲盒信息，用户信息）
 */
class HeadAction extends ActionPlugin
{
    const USER_LEVEL = self::LEVEL_NOTHING;

    public function main()
    {
        $userInfo = User::getBasicUserInfo($this->uid);
        if ($this->uid) {
            $point = Point::getPoint($this->uid);
            $userInfo['point'] = $point;
        }
        $boxInfo = BlindBox::getUserBox($this->uid);
        $boxMap = BlindBox::getBlindBox($this->uid);
        $boxList = array_values($boxMap);
        $result = [
            'user_info' => $userInfo,
            'box_info' => $boxInfo,
            'box_list' => $boxList,
        ];
        $this->setSuccess($result);
    }
}